<template>
	<view>
		<view class="container">
			<header-view type="second" leftShow rightShow>新闻</header-view>
			<view class="content">
				 <view class="list" v-for="(item,index) in noticeList" :key="item.id">
				<view class="text" @tap="toNoticeDetail">{{ item.name }}</view>
				<view class="time">{{ item.time }}</view>
				 </view>
				
			</view>
		</view>
	</view>
</template>

<script>
	import headerView from "@/components/headerView/index.vue"
	import { noticeListApi } from "@/api/api.js"
	export default {
		components: {
			headerView
		},
		data() {
			return {

            noticeList:[],
			};
		},
		mounted() {
			this.getNoticeList()
		},
		methods: {
			toNoticeDetail() {
				uni.navigateTo({
					url: "/pages/noticeDetail/noticeDetail"
				})
			},
			
			getNoticeList(){
				noticeListApi().then(res=>{
					this.noticeList=res.data.data
					console.log(res.data.data,"公告列表>>>>>>>")
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {}
	.content{
		width: 100%;
		height: 210rpx;
		//background-color: antiquewhite;
		padding-left: 20rpx;
		padding-right: 20rpx;
		.list{
			.text{
				color: white;
				margin-top: 50rpx;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
			}
			.time{
				color: gray;
				font-size: 15px;
				margin-top: 70rpx;
			}
		}
		
	}
</style>
